home *** CD-ROM | disk | FTP | other *** search
/ 130 MIDI Tool Box / 130 MIDI Tool Box.iso / mpu401 / mpudsr.c < prev    next >
C/C++ Source or Header  |  1986-11-02  |  463b  |  25 lines

  1. /* Copyright (C) 1986 by M. J. Shannon, Jr.
  2. ** Permission to distribute for non-commercial uses granted as long as this
  3. ** notice is retained.  Violators will be prosecuted.
  4. */
  5.  
  6. #include    "mpu.h"
  7.  
  8. /* mpu_dsr():
  9. **    wait for MPU ready to send data, with timeout.
  10. */
  11.  
  12. int
  13. mpu_dsr()
  14. {
  15.     long counter;
  16.     int stat;
  17.  
  18.     for (counter = 0xFFFFL; counter != 0; --counter)
  19.     {
  20.         if ((stat = inp(MPUP_STAT) & MPUPS_DSR) == 0)
  21.             break;
  22.     }
  23.     return (stat);
  24. }
  25.